/*
 * Copyright (c) 2012 by Chances.
 * $CVSHeader$
 * $Author$
 * $Date$
 * $Revision$
 */
package chances.epg.user.controller;

import javax.servlet.http.HttpServletRequest;

import chances.epg.commons.utils.RequestUtils;
import chances.epg.data.PageBean;

/**
 * Class comments.
 * 
 * @author <a href="mailto:libf@chances.com.cn">libf</a>
 */
public abstract class UserAbstractController {
	
	
	public static final int SUCCESS = 200;
	public static final int VALID_PARAM = 1001;
	public static final int VALID_TOKEN = 1002;
	
	public static final int DB_ERROR = 9001;
	public static final int SYS_ERROR = 9002;
	


    
    protected PageBean getPageBean(HttpServletRequest request) {
    	int curPage = RequestUtils.getParameter(request, "pageIndex", 1);
    	int size = RequestUtils.getParameter(request, "pageSize", 20);
    	PageBean pageBean = new PageBean(size);
    	pageBean.setCurrentPage(curPage);
    	return pageBean;
    }
}
